<style lang="scss" scoped>
  .bar-text {
      position: relative;
      display: flex;
      align-items: center;
      font-size: 1.6rem;
	    padding: 1rem 0;
	    border-bottom: 1px solid #c7c7c7;
      .returns {
        margin: 0 0.6rem;
      }
      .bar-title {
        position: absolute;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
      }
    }
</style>
<template>
  <div class="bar-text">
    <van-icon name="arrow-left" size="20" @click="getBack" />
    <span class="returns" @click="getBack">返回</span>
    <span @click="backHome" v-show=" num == '详情' ?  false : true" >关闭</span>
    <span class="bar-title">{{ title }}</span>
  </div>
</template>
<script>
import Tabbar from "../components/Tabbar.vue";
export default {
  components: {
    myTabbar: Tabbar
  },
  props: {
    title: {
        type: String,                 //可指定接收类型，如:Array.
        default:"this is default"     //可设置默认值
    }
  },
  data() {
    return {
      isshow: false,
      num: ''
    }
  },
  mounted () {
    this.num= this.$router.history.current.name
    console.log(this.num);
  },
  methods: {
    getBack() {
      // console.log(111111);
      this.$emit('getBack',this.$router)
      // this.$emit('getBack',this.$store.dispatch('setFeedback', []))
    },
    backHome() {
      // console.log(111111);
      this.$emit('backHome', this.$router)
      // this.$emit('backHome', this.$store.dispatch('setFeedback', []))
    }

  }
};
</script>